Skip to content

feat: juju_charm datasource and a upgrades.tf file#278

Merged
MichaelThamm merged 13 commits intomainfrom
feat/juju-charm
Apr 21, 2026
Merged

feat: juju_charm datasource and a upgrades.tf file#278
MichaelThamm merged 13 commits intomainfrom
feat/juju-charm

Conversation

@MichaelThamm
Copy link
Copy Markdown
Contributor

@MichaelThamm MichaelThamm commented Apr 20, 2026

Issue

Since we need to move to workload tracks for charms, our product component (the charm TF modules) tracks will no longer be in sync. This means that the channel input is not useful in products and we really only care about risk.

Blocked by:

Cross-track upgrades will be covered by:

Solution

We can hardcode the tracks of the components e.g., 0.31 for alertmanager and 3.10 for prometheus in the module TF tag 3.0.n. The user should not have to concern themselves with what track of COS they want because this has caused confusion in the past i.e., the reason we added channel input validation, which is simplified if we only expose a risk.

Checklist

Context

We decided that it is okay for the product module to not surface the channel input, but charm modules must continue to surface this in their API to match the TF Juju provider API and the rest of the Juju TF ecosystem. We can require channel validation for each charm module to improve the user experience by not allowing the TF to outlive the charm.

Testing Instructions

COS Lite

Since we do not have the workload tracks ready yet, I hardcoded the tracks to dev:

locals {
  tracks = {
    alertmanager = "dev"
    catalogue    = "dev"
    grafana      = "dev"
    loki         = "dev"
    prometheus   = "dev"
    ssc          = "1"
    traefik      = "latest"
}

and applied with:

module "cos-lite" {
  source       = "../../terraform/cos-lite"
  model_uuid   = juju_model.cos-lite.uuid
  risk         = "edge"
  internal_tls = false
Apply complete! Resources: 32 added, 0 changed, 0 destroyed.

COS

Since we do not have the workload tracks ready yet, I hardcoded the tracks to dev:

locals {
  tracks = {
    alertmanager = "dev"
    catalogue    = "dev"
    grafana      = "dev"
    loki         = "dev"
    mimir        = "dev"
    otelcol      = "dev"
    tempo        = "dev"
    s3_integrator = "2"
    ssc           = "1"
    traefik       = "latest"
}
module "cos" {
  source       = "../../terraform/cos"
  model_uuid   = juju_model.cos.uuid
  risk         = "edge"
  internal_tls = false

  s3_endpoint   = "http://${data.external.juju_nori_address.result.address}:8333" # Seaweed
  s3_secret_key = "placeholder"
  s3_access_key = "placeholder"

  loki_coordinator  = { units = 1 }
  loki_worker       = { backend_units = 1, read_units = 1, write_units = 1 }
  mimir_coordinator = { units = 1 }
  mimir_worker      = { backend_units = 1, read_units = 1, write_units = 1 }
  tempo_coordinator = { units = 1 }
  tempo_worker      = { compactor_units = 1, distributor_units = 1, ingester_units = 1, metrics_generator_units = 1, querier_units = 1, query_frontend_units = 1 }
}
Apply complete! Resources: 85 added, 0 changed, 0 destroyed.

Upgrade Notes

Previously, if you deploy COS on day 1 and then on day 2, you would always get the same revisions. This is no longer the case and charm revisions might change per apply because they are picked "latest in track". To pin these revisions, use the revision input per COS component.

@MichaelThamm MichaelThamm changed the base branch from main to fix/remove-channel-validation April 20, 2026 16:46
@MichaelThamm MichaelThamm changed the title Feat/juju charm feat: juju_charm datasource and a upgrades.tf file Apr 20, 2026
Base automatically changed from fix/remove-channel-validation to main April 20, 2026 20:15
Signed-off-by: Michael Thamm <mike.thamm@canonical.com>
@MichaelThamm MichaelThamm marked this pull request as ready for review April 21, 2026 12:12
@MichaelThamm MichaelThamm requested a review from a team as a code owner April 21, 2026 12:12
@MichaelThamm MichaelThamm merged commit 75f5e0b into main Apr 21, 2026
5 of 15 checks passed
@MichaelThamm MichaelThamm deleted the feat/juju-charm branch April 21, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants